// js 单线程 event loop 异步多任务，不支持sleep
// setTimeout + callback  es5
let fun = () => console.log('time out');

let sleep = function(func,time) {
    setTimeout(() => {
        func();
    },time)
}

sleep(fun,2000)